// Decompiled by GOOSIN CO,LTD Copyright 2010 Pavel Kouznetsov.
// home page: http://www.Goosin.net
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   getColumn.java

package include.get_sql;

import include.nseer_db.nseer_db;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;

public class getColumn
{

	private String dbase;
	private String tableName;
	private nseer_db erp_db;
	private String column[];

	public getColumn()
	{
		dbase = "";
		tableName = "";
		column = new String[1000];
	}

	public String[] Column(String database, String tName)
	{
		dbase = database;
		tableName = tName;
		erp_db = new nseer_db(dbase);
		try
		{
			String sql1 = (new StringBuilder("select * from ")).append(tableName).toString();
			ResultSet rs = erp_db.executeQuery(sql1);
			ResultSetMetaData rsmd = rs.getMetaData();
			int number = rsmd.getColumnCount();
			column = new String[number - 1];
			for (int i = 2; i <= number; i++)
				column[i - 2] = rsmd.getColumnName(i);

			erp_db.close();
		}
		catch (Exception ex)
		{
			ex.printStackTrace();
		}
		return column;
	}
}
